{% extends "htmlPages/base.html" %}

        {% block head %}
            <script type="text/javascript" src="../static/js/deleteMsg.js"></script>
            <style type="text/css">
             a:hover {
                cursor:pointer;
             }
            </style>
        {% endblock head %}

        {% block side_navbar %}
            <ul class="nav navbar-nav side-nav">
            <li>
              <a href="/home"><i class="fa fa-desktop"></i>  דף בית </a>
            </li>
            <li class="active">
              <a href=""><i class="fa fa-bullhorn"></i>  לוח מודעות </a>
            </li>
            <li>
              <a href="/privateMessages"><i class="fa fa-edit"></i>  הודעות אישיות </a>
            </li>
            <li>
              <a href="/contactList"><i class="fa fa-file"></i>  דף קשר </a>
            </li>
          </ul>
        {% endblock side_navbar %}

        {% block page_wrapper %}
            <div class="row">
              <div class="col-lg-12">
                  <h1>
                      לוח מודעות
                    <small>{{ date }}</small>
                  </h1>
              </div>
            </div>

            <div class="row" dir="ltr">
                <div class="col-lg-12 pull-left">
                    <p>
                <a class="btn btn-success" href="/addMessage">
    הוסף הודעה חדשה
                </a>
                    </p>
                </div>
            </div>

{%- for message in messages %}
            <div class="row">
                <div class="col-lg-11 pull-right">
                <div class="panel panel-info">
                  <div class="panel-heading">
                      <div class="row">
                        <div class="col-lg-6 pull-right">
                            <h3 class="panel-title"><i class="fa fa-bullhorn"></i> {{ message.title }}</h3>
                        </div>
                        <div class="col-lg-6 text-left">
                            {{ message.date }}
                        </div>
                      </div>
                  </div>
                  <div class="panel-body">
                      <p>{{ message.msg|safe }}</p>
                  </div>
                    <div class="panel-footer text-left">
                        <a onclick="createCustomModal({{ message.id }})"><i class="fa fa-trash-o"></i></a>
                  </div>
                </div>
              </div>
            </div>
{%- endfor -%}

<div class ="modal fade" id ="approveDelete" role ="dialog">
            <div class = "modal-dialog">
                <div class = "modal-content">
                    <div class = "modal-header">
                        <div class="row">
                            <div class="col-lg-10 pull-right">
                                <h1>
מחיקת הודעה
                                </h1>
                            </div>
                            <div class="col-lg-2 text-left">
                                <a class = "btn btn-danger" data-dismiss = "modal">&times;</a>
                            </div>
                        </div>
                    </div>
                    <div class = "modal-body">
                        <p>
האם הינך בטוחה כי ברצונך למחוק הודעה זו?
                        </p>
                    </div>
                    <div class = "modal-footer" style="text-align:center">
                        <a id="deleteMsg" class = "btn btn-success"><i class="fa fa-trash-o"></i> מחק
                        </a>
                        <a class = "btn btn-default" data-dismiss = "modal">
ביטול
                        </a>
                    </div>
                </div>
            </div>
        </div>

        {% endblock page_wrapper %}
